package org.travel.api.travel.pojo;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import java.sql.Timestamp;
import java.util.Objects;

@Entity
public class Area {
    private Integer areaid;
    private String areaName;
    private Integer parentId;
    private Integer level;
    private String pinYin;
    private Timestamp createDate;
    private Timestamp modifiedDat;

    @Id
    @Column(name = "areaid", nullable = false)
    public Integer getAreaid() {
        return areaid;
    }

    public void setAreaid(Integer areaid) {
        this.areaid = areaid;
    }

    @Basic
    @Column(name = "areaName", nullable = false, length = 255)
    public String getAreaName() {
        return areaName;
    }

    public void setAreaName(String areaName) {
        this.areaName = areaName;
    }

    @Basic
    @Column(name = "parentId", nullable = false)
    public Integer getParentId() {
        return parentId;
    }

    public void setParentId(Integer parentId) {
        this.parentId = parentId;
    }

    @Basic
    @Column(name = "level", nullable = false)
    public Integer getLevel() {
        return level;
    }

    public void setLevel(Integer level) {
        this.level = level;
    }

    @Basic
    @Column(name = "pinYin", nullable = false, length = 255)
    public String getPinYin() {
        return pinYin;
    }

    public void setPinYin(String pinYin) {
        this.pinYin = pinYin;
    }

    @Basic
    @Column(name = "createDate", nullable = false)
    public Timestamp getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Timestamp createDate) {
        this.createDate = createDate;
    }

    @Basic
    @Column(name = "modifiedDat", nullable = false)
    public Timestamp getModifiedDat() {
        return modifiedDat;
    }

    public void setModifiedDat(Timestamp modifiedDat) {
        this.modifiedDat = modifiedDat;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Area area = (Area) o;
        return Objects.equals(areaid, area.areaid) &&
                Objects.equals(areaName, area.areaName) &&
                Objects.equals(parentId, area.parentId) &&
                Objects.equals(level, area.level) &&
                Objects.equals(pinYin, area.pinYin) &&
                Objects.equals(createDate, area.createDate) &&
                Objects.equals(modifiedDat, area.modifiedDat);
    }

    @Override
    public int hashCode() {
        return Objects.hash(areaid, areaName, parentId, level, pinYin, createDate, modifiedDat);
    }
}
